package com.binyouwei.customize_compose_view

import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.activity.enableEdgeToEdge
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.width
import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.colorResource
import androidx.compose.ui.unit.dp
import com.binyouwei.customize_compose_view.histogram.Histogram
import com.binyouwei.customize_compose_view.histogram.HistogramData

class MainActivity : ComponentActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        enableEdgeToEdge()
        setContent {
            val data =
                remember {
                    listOf(
                        HistogramData("1月", 10f),
                        HistogramData("2月", 25f),
                        HistogramData("3月", 20f),
                        HistogramData("4月", 58f),
                        HistogramData("5月", 25f),
                        HistogramData("6月", 45f),
                        HistogramData("7月", 97f),
                        HistogramData("8月", 55f),
                        HistogramData("9月", 32f),
                        HistogramData("10月", 68f),
                        HistogramData("11月", 88f),
                        HistogramData("12月", 16f)
                    )
                }
            Histogram(data,
                Modifier
                    .width(400.dp)
                    .height(400.dp))
        }
    }
}

